layui.use('form', function () {
    var form = layui.form
        , layer = layui.layer;
});

function personMessage() {
    var userId = $("#userId").val();
    var aiName = $("#aiName").val();
    var email = $("#email").val();
    var remark = $("#remark").val();

    var per = new Object();
    per["userid"] = userId;
    per["aiName"] = aiName;
    per["email"] = email;
    per["remark"] = remark;

    var perDate = JSON.stringify(per);
    $.ajax({
        url: basePath + "/personMessage",
        data: perDate,
        contentType: "application/json;charset=UTF-8",
        type: "post",
        dataType: "json",
        beforeSend: function () {
            layer.msg('修改中', {
                icon: 16,
                shade: 0.01

            });
        },
        complete: function () {
            layer.closeAll('loading');
        },
        success: function (data) {
            if (data.status == 200) {
                layer.msg(data.message, {
                    time: 1000,
                    icon: 1,
                    offset: '350px'
                }, function () {
                    location.href = basePath + "/information";//成功登录后转跳的页面
                });
            } else {
                layer.msg(data.message, {
                    time: 1500,
                    icon: 2,
                    offset: '350px'
                });
            }

        }

    });


}